//导入 函数  create 创建  store 仓库
import {createStore} from 'redux';
//导入 thunk
import thunk from 'redux-thunk';
//导入 applyMiddleware
import {applyMiddleware, combineReducers} from 'redux';
//导入 countReduer 文件
import countReducer from './reducers/CountReducer';
//导入 zanReducer 文件
import zanReducer from './reducers/zanReducer';
//导入开发工具
import {composeWithDevTools} from 'redux-devtools-extension'
import todoReducer from './reducers/todoReducer';

//合并 reducer 函数, 合并 reducer 函数之后, redux 中的状态值将会变为一个『对象』
let reducer = combineReducers({
  count: countReducer,
  zan: zanReducer,
  todo: todoReducer
});

//创建数据仓库(对象)   action 动作对象  
// store 的状态初始值, 是由回调函数第一次执行得到的
let store = createStore(reducer,  composeWithDevTools(applyMiddleware(thunk)));


//暴露 store 对象
export default store;



